@import '../variables.css';

.selectionRoot {
  position: relative;
}

.selectionListRoot {
  z-index: 9999;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: var(--shadow);
}

.selectionListStatus {
  padding: 4px 8px;
  border-bottom: 1px solid #ccc;
}

.selectionList {
  list-style: none;
  padding: 4px;
  margin-bottom: 0;
  overflow: auto;
  position: relative;
}

.selectListSection {
  padding: 4px;
}

.selectionControl {
  line-height: var(--line-height);
  padding: var(--input-vertical-padding) var(--input-horizontal-padding);
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  &.marginBottom0 {
    /* stylelint-disable-next-line length-zero-no-unit */
    margin-bottom: 0;
  }
}

.selectionFilterContainer {
  padding: 0.5rem;
}

.selectionEndControls {
  pointer-events: none;
  height: 100%;
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  padding-right: 2px;
  width: 100%;
  justify-content: flex-end;
}

.selectionFilter {
  width: 100%;
  padding: 4px 8px;
  border-style: solid;
  border-color: var(--color-border);

  &:focus {
    outline: none;
    border-color: var(--primary, #0c577f);
  }
}

.selectionControlContainer {
  position: relative;
  width: 100%;
}

.selectionMobileBackdrop {
  position: fixed;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.2);
  padding-top: 48px;
  align-items: flex-start;
  pointer-events: all;
}

.singleValue {
  display: flex;
  width: 90%;
}

/* Selection List Options */

.option {
  padding: 0.5rem;
  cursor: default;
  display: flex;
  justify-content: space-between;

  &.selected {
    background: var(--color-fill-current);
    color: #fff;
    transition: all 0.2s;

    &:hover {
      background-color: var(--color-fill-current);
    }

    &.cursor {
      background-color: var(--color-fill-current);
    }
  }

  &.cursor {
    background-color: var(--color-fill-hover);
  }

  &:hover {
    background-color: var(--color-fill-hover);
  }

  &.optionCentered {
    justify-content: center;
  }

  &.optionStart {
    justify-content: flex-start;
  }

  &.optionEnd {
    justify-content: flex-end;
  }

  &.optionOutside {
    justify-content: space-between;
  }
}

.optionSegment {
  padding: 0 2px;
  text-align: initial;
  word-break: break-word;
}

.selectionMultiContainer {
  border: 1px solid var(--color-border);
  padding: 0 4px;
  padding-right: 24px;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
}

.selectionFilterInline {
  min-width: 100px;
  width: 100%;
  border-width: 0;
  padding: 2px 4px;
}

.selectionMultiSelected {
  list-style: none;
  flex-wrap: wrap;
  display: flex;
  padding: 0;
  margin-bottom: 0;
}

.selectionMultiSelectedItem {
  display: inline-block;
  margin: 2px;
}

.selectionMultiInputContainer {
  flex: 2 2 auto;
  display: inline-block;
  margin: 3px;
}

.selectionClearAll {
  pointer-events: all;
}

.selectionMultiSelectInputContainer {
  margin: 2px;
  flex: 2 2 auto;
}

.selectionEmptyMessage {
  font-weight: bold;
  padding: 6px;
}

.srOnly {
  position: absolute !important;
  clip: rect(1px 1px 1px 1px); /* old IE */
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  width: 1px;
  overflow: hidden;
}

*[dir="rtl"] {
  & .selectionMultiContainer {
    padding-left: 24px;
    padding-right: 0;
  }
}
